<template>
	<view>
		<customersThread v-if="modelValue==1 && valueModel==1" ref='customerThreadRef'></customersThread>
		<customersAllocation v-if="modelValue==2 && valueModel==2" ref='customersAllocationRef'></customersAllocation>

	</view>
</template>

<script>
	import customersAllocation from '@/pages/customersAllocation/customersAllocation.vue'
	import customersThread from '@/pages/customersThread/customersThread.vue'
	import {
		mapState
	} from 'vuex' //引入mapState
	export default {
		data() {
			return {
				valueModel: 0
			}
		},
		components: {
			customersAllocation,
			customersThread
		},
		computed: mapState({
			// 从state中拿到数据 箭头函数可使代码更简练
			modelValue: state => state.vuex_tabbar,

		}),

		watch: {

		},

		onShow() {
			this.valueModel = this.modelValue
		},
		onHide() {

		},
		onLoad() {
			this.valueModel = this.modelValue
		}
	}
</script>

<style>

</style>
